package com.validate;

import com.dto.CellValidateResult;
import com.dto.RowValidateResult;
import com.filter.AbstractValidator;
import com.helper.Student;

public class ChckePhone extends AbstractValidator<RowValidateResult, Student> {
    @Override
    protected RowValidateResult validate(Student dto) {
        RowValidateResult row = null;
    boolean b = checkPhone(dto);
    if (!b){
        row = new RowValidateResult();
        row.setIndex(dto.getIndex());
        row.setRows(new CellValidateResult("手机号位数不对"));
    }
        return row;
    }
    private boolean checkPhone(Student dto){
        if (dto.getPhone().length()!=11){
            return false;
        }
        return true;
    }


}
